package edu.tongji.structureplayer.structure.test
{
    import edu.tongji.structureplayer.structure.Node;
    import edu.tongji.structureplayer.structure.WellBehavedStructure;
    
    import flexunit.framework.Assert;
    
    
    public class TestNode
    {
        private var structure:WellBehavedStructure;
        
        [Before]
        public function setUp():void
        {
            structure = new WellBehavedStructure();
        }
        
        [After]
        public function tearDown():void
        {
            structure = null;
        }
        
        [BeforeClass]
        public static function setUpBeforeClass():void
        {
        }
        
        [AfterClass]
        public static function tearDownAfterClass():void
        {
        }
        
        [Test]
        public function testAddNode():void
        {
            var date:Date = new Date();
            var name:String = date.getTime().toString();
            var size:uint = structure.numberOfNode();
            try {
                structure.addNode(name, Math.random()*10, Math.random()*10);
            } catch (e:Error) {
                Assert.fail(e.message);
            }
            Assert.assertEquals(size+1, structure.numberOfNode());
        }
        
        [Test]
        public function testFindNodeByIndex():void
        {
            Assert.fail("Test method Not yet implemented");
        }
        
        [Test]
        public function testFindNodeByName():void
        {
            Assert.fail("Test method Not yet implemented");
        }
        
        [Test]
        public function testFindNodeByPosition():void
        {
            Assert.fail("Test method Not yet implemented");
        }
        
        [Test]
        public function testRemoveNodeByIndex():void
        {
            Assert.fail("Test method Not yet implemented");
        }
        
        [Test]
        public function testRemoveNodeByName():void
        {
            Assert.fail("Test method Not yet implemented");
        }
        
        [Test]
        public function testRemoveNodeByPosition():void
        {
            Assert.fail("Test method Not yet implemented");
        }
    }
}